<template>
	<view class="item_box" @click.stop="routeDeatil">
		<image :src="query.avatar" mode="aspectFill" class="Coach-profile-picture"
			@click.stop="$PREVIEW_IMAGE(query.avatar)"></image>
		<view class="right_comlumn">
			<view class="name">
				<text class="size">
					{{query.nickname}}
				</text>
				<image :src="query.star_image" mode="" class="star" v-if="query.star_image"></image>
			</view>
			<view class="grade-box">
				<view class="grade">
					{{query.serve}}分
				</view>
				<view class="dashed-box">

				</view>
				<view class="good-reputation">
					好评率{{query.vea}}
				</view>
			</view>
			<view class="scound-box">
				<view class="one_box">
					<text class="size1 row1">证书</text>
					<text class="size2 row1">{{query.cert_num}}</text>
					<text class="size1 row1">本</text>
					<view class="dashed-box">

					</view>
					<view class="one_box">
						<text class="size1 row1">上课</text>
						<text class="size2 row1">{{query.course_num}}</text>
						<text class="size1 row1">节</text>
					</view>
				</view>
				<view class="bottom">
					<view v-for="(skillItem,skillIndex) in query.domain_list" :key="skillIndex" class="skillItem">
						{{skillItem.title}}
					</view>
				</view>
			</view>
			<view class="content">
				{{query.bio}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			query: {
				type: null,
				default: null,
				required: true
			},
			clickShow: {
				type: Boolean,
				default: false,
				required: true
			}
		},
		methods: {
			routeDeatil() {
				if (!this.clickShow) {
					uni.navigateTo({
						url: '/pageA/shop/coach/deatil?coach_id=' + this.query.coach_id
					})
				}

			},

		}
	}
</script>

<style lang="scss" scoped>
	// 虚线
	.dashed-box {
		width: 2rpx;
		height: 28rpx;
		border: 1rpx solid #e9e9e9;
		margin: 0 11rpx;
	}

	.item_box {
		width: 100%;
		display: flex;
		flex-direction: row;

		.Coach-profile-picture {
			width: 234rpx;
			height: 310rpx;
			background: rgba(0, 0, 0, 0.00);
			border-radius: 16rpx;
			margin-right: 20rpx;
		}

		.recommend {
			position: absolute;
			top: 0;
			right: 0;
			width: 136rpx;
			height: 38rpx;

		}

		.right_comlumn {
			display: flex;
			flex-direction: column;
			width: 408rpx;

			.name {
				width: 408rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				
				margin-bottom: 4rpx;
				
				.size{
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 1;
					/* 限制显示的行数为1 */
					overflow: hidden;
					text-overflow: ellipsis;
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: left;
					color: #333333;
				}
				.star{
					width: 54rpx;
					height: 30rpx;
					margin-left: 12rpx;
				}
			}

			.grade-box {
				padding-bottom: 10rpx;
				width: 100%;
				border-bottom: 1rpx dashed #e9e9e9;
				display: flex;
				flex-direction: row;
				align-items: center;

				.grade {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: left;
					color: #f37364;
				}

				.good-reputation {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: left;
					color: #666666;
				}
			}

			.scound-box {
				display: flex;
				flex-direction: column;
				width: 100%;
				padding: 16rpx 0 14rpx;
				border-bottom: 1rpx dashed #e9e9e9;

				.one_box {
					display: flex;
					flex-direction: row;
					align-items: center;

					.row1 {
						font-size: 24rpx;
						font-weight: 500;
						color: #333333;

					}

					.size1 {
						color: #333333;
					}

					.size2 {
						color: #73F0EA;
					}
				}

				.bottom {
					margin-top: 10rpx;
					display: flex;
					flex-direction: row;
					align-items: center;

					.skillItem {
						padding: 0 4rpx;
						height: 28rpx;
						background: #f6f6f6;
						border-radius: 4rpx;
						margin-right: 6rpx;
						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 20rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						text-align: left;
						color: #666666;
					}
				}
			}

			.content {
				padding-top: 14rpx;
				width: 100%;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Medium;
				font-weight: 500;
				text-align: left;
				color: #666666;
			}
		}
	}
</style>